package com.food.dao.service;

import java.util.List;

import com.food.dao.FooddetailDAOJdbc;
import com.food.dao.in.FooddetailDAO;
import com.food.model.Fooddetail;

public class FooddetailService {
	private FooddetailDAO dao = new FooddetailDAOJdbc();
	public void insertFoodDetail(Fooddetail bean){
		if(bean!=null){
			dao.insertFoodDetail(bean);
		}
	}
	public void updateFoodDetail(Fooddetail bean){
		if(bean!=null){
		dao.updateFoodDetail(bean.getRid(), bean.getFdname(), 
								bean.getFdunit(), bean.getFdid());
		}
	}
	public void deleteFoodDetail(Fooddetail bean){
		if(bean!=null) {
			dao.deleteFoodDetail(bean.getFdid());
		}
	}
	public List<Fooddetail> findFoodDetailByRecipe(Fooddetail bean){
		return dao.findFoodDetailByRecipe(bean.getRid());
	}
}
